<%@ Page Language="VB" MasterPageFile="~/main.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default"  %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit"%> 

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">


<script type="text/javascript">
    function IsOneDecimalPoint(evt) 
    {
            var charCode = (evt.which) ? evt.which : event.keyCode;
            var parts = evt.srcElement.value.split('.');
            if (parts.length > 1 && charCode == 46)
                return false;
            if (parts.length > 1)
            {
                if ( parts[1].length>1)
                    return false;
            }
            else
            {
                if ( evt.srcElement.value.length>4 && charCode != 46)
                    return false;
            }
            return true;
    }
    
    function ConfirmationMessage()
    {
        document.getElementById("<%=hdnDate.ClientID %>").value = document.getElementById("<%=txtDate.ClientID %>").value;
        if ( window.confirm( "Data once submitted cannot be changed without approval. Please confirm!")   == true)
        {
            if ( window.confirm( "Do you want to print reciept for the transaction")   == true)
            {
                document.getElementById("<%=hdnPrintVoucher.ClientID %>").value = "y";
            }
            else
            {
                document.getElementById("<%=hdnPrintVoucher.ClientID %>").value = "n";
            }
        }
        else
            return false;
        
    }
    
    function fnOpen() {
    //"height=600,width=800,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,modal=yes"
      window.open ('ShowVouchersPopup.aspx?mode=<%=Request.QueryString("mode")%>', "child", "height=600,width=800,toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no");
    }
</script>
    
<table border="0" width="100%" style="text-align:left; padding-left:20px; font-size:10pt;">
    <tr>
        <td colspan="3">
            <h2><asp:Label ID="lblHeader" runat="server" Text="Create New Cash Reciept"></asp:Label></h2>
            <asp:HiddenField ID="hdnPrintVoucher" runat="server"  Value="n"/>
        </td>
    </tr>
    <tr>
        <td style="width:120px;">
            Voucher Number:
        </td>
        <td style="width:120px;">
            <table width="100%" border="0">
                <tr>
                    <td>
                        <asp:TextBox ID="txtVoucher" runat="server" Enabled="true" Width="20px" ></asp:TextBox>
                    </td>
                    <td>
                        <input type="button" id="VNo" name="VNo" value="Override V No" onclick="fnOpen();" />
                    </td>
                </tr>
            </table>
        </td>
        <td>
            &nbsp;
        </td>
    </tr>
    <tr>
        <td style="width:120px;">
            Date:
        </td>
        <td style="width:120px;">
            <asp:TextBox ID="txtDate" runat="server" ReadOnly="true" EnableViewState="true"></asp:TextBox>
            <ajaxToolkit:CalendarExtender runat="server" TargetControlID="txtDate" 
                Format="MMMM d, yyyy" />
            <asp:HiddenField ID="hdnDate" runat="server" />
        </td>
        <td>
            &nbsp;
        </td>
    </tr>
    <tr>
        <td style="vertical-align:top;">
            Description:
        </td>
        <td style="width:120px;">
            <asp:TextBox ID="txtDesc" runat="server" TextMode="MultiLine" Width="300px" Height="70px"></asp:TextBox>
        </td>
        <td>
            
        </td>
    </tr>
    <tr>
        <td>
            Transaction Type:
        </td>
        <td style="width:120px;">
            <asp:DropDownList ID="drpType" runat="server" Width="200px"></asp:DropDownList>
            <asp:TextBox ID="txtRecieptDtls" runat="server" Width="150px" Visible="false"></asp:TextBox>
        </td>
        <td>
            
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="lblFromTo" runat="server" Text="Deposited By" ></asp:Label>
        </td>
        <td style="width:120px;">
            <asp:DropDownList ID="drpFromTo" runat="server" Width="200px"></asp:DropDownList>
        </td>
        <td>
            
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="lblCash" runat="server" Text="Reciept Cash" ></asp:Label>
        </td>
        <td style="width:120px;">
            <asp:TextBox ID="txtCash" runat="server"  Width="100px" MaxLength="8" onkeypress="return IsOneDecimalPoint(event);" ></asp:TextBox>
            <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender" runat="server" FilterType="Custom" ValidChars="01234567890." TargetControlID="txtCash" ></ajaxToolkit:FilteredTextBoxExtender>
        </td>
        <td>
            
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="lblBank" runat="server" Text="Reciept Bank" ></asp:Label>
        </td>
        <td style="width:120px;">
            <asp:TextBox ID="txtBank" runat="server"  Width="100px" MaxLength="8" onkeypress="return IsOneDecimalPoint(event);"></asp:TextBox>
            <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" FilterType="Custom" ValidChars="01234567890." TargetControlID="txtBank" ></ajaxToolkit:FilteredTextBoxExtender>
        </td>
        <td>
            
        </td>
    </tr>
     <tr>
        <td>
            <asp:Label ID="lblWithdrawn" runat="server" Text="Payment Withdrawn" ></asp:Label>
        </td>
        <td style="width:120px;">
            <asp:TextBox ID="txtBankWithdraw" runat="server"  Width="100px" MaxLength="8" onkeypress="return IsOneDecimalPoint(event);"></asp:TextBox>
            <ajaxToolkit:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" FilterType="Custom" ValidChars="01234567890." TargetControlID="txtBankWithdraw" ></ajaxToolkit:FilteredTextBoxExtender>
        </td>
        <td>
            
        </td>
    </tr>
    <tr>
        <td colspan="3">
            &nbsp;
        </td>
    </tr>
    <tr>
        <td colspan="3" >
            <asp:Button ID="btnSave" Text="Save" runat="server" Width="100px" />
            &nbsp;&nbsp;
            <asp:Button ID="btnClear" Text="Clear All" runat="server" Width="100px"/>
        </td>
    </tr>
    <tr>
        <td colspan="3">
            &nbsp;
        </td>
    </tr>
    <tr>
        <td colspan="3" style="font-size:14pt; font-weight:bold; font-family:Arial;">
            <asp:Label ID="lblMessage" runat="server" ></asp:Label>
        </td>
    </tr>
</table>

</asp:Content>

